home *** CD-ROM | disk | FTP | other *** search
- unit VPENGINE;
-
- interface
-
- Uses WinTypes, WinProcs
- {$IFDEF VER80}
- ,Messages; {Units for Delphi}
- {$ELSE}
- ;
- {$ENDIF}
-
- {/// }
- {/// VPECOMON.H }
- {/// ========== }
- {/// }
- {/// Common definitions for the "Virtual Print Engine" }
- {/// }
- {/// 01/95 by IDEAL Software, T. Radde }
- {/// }
-
- {/// VpeOpenDoc() Flag Parameters: }
- {/// ============================= }
- Const VPE_GRID_INBACKGROUND = 1; {// Grid in Background}
- VPE_GRID_INFOREGROUND = 2; {// Grid in Foreground}
- VPE_GRID_TOOLBARBUTTON = 4; {// Grid Toolbar-Button visible}
- VPE_GRID_VISIBLE = 8; {// Actually Grid visible}
-
- VPE_NO_RULER = 16; {// Ruler NOT visible}
- VPE_NO_TOOLBAR = 32; {// Toolbar NOT visible}
- VPE_NO_USER_CLOSE = 64; {// User can't close VPE -}
- {/// Stop-Button INVISIBLE and Sys-Menu }
- {/// disabled (if not embedded) }
- {/// VpeCloseDoc() works! }
- VPE_NO_USER_MOVE = 128; {// User can't leaf through the document}
- {/// in future: then no Page-Seg in Statusbar }
- VPE_NO_MOUSE_SCALE = 256; {// User can't scale with the MOUSE (VpeSetScale() works!)}
- VPE_NO_USER_SCALE = (512 or VPE_NO_MOUSE_SCALE); {// User can't scale (VpeSetScale() works!)}
- {/// in future: then no Scale-Seg in Statusbar }
-
- VPE_NO_STATBAR = 1024; {// Statusbar invisible}
-
- VPE_NO_PRINTBUTTON = 2048; {// Print-Button invisible}
- {/// VpePrintDoc() works }
-
- VPE_EMBEDDED = 4096; {// Document Window is embedded within}
- {/// a window of the calling application }
- VPE_LANDSCAPE = 8192; {// Document will be printed in Landscape-Format}
- VPE_MEMORY_SWAP = 16384; {// Each page is swapped to a temporary file, so that}
- {/// only one page is held in memory (NOT implemented yet!) }
- VPE_NO_HELPBTN = 32768; {// Help-Button invisible}
- VPE_ROUTE_HELP = 65536; {// if Help-Button visible, pressing this or pushing the F1-key}
- {/// will cause the message VPE_HELP to be send to the owner-window, }
- {/// no matter if the VPE-window is embedded or not }
- VPE_NO_INFOBTN = 131072; {// Info-Button invisible}
-
- VPE_GRID_POSSIBLE = (VPE_GRID_INFOREGROUND or VPE_GRID_TOOLBARBUTTON);
- VPE_GRID_ON = (VPE_GRID_INFOREGROUND or VPE_GRID_TOOLBARBUTTON or VPE_GRID_VISIBLE);
- VPE_GRID_BKGON = (VPE_GRID_INBACKGROUND or VPE_GRID_TOOLBARBUTTON or VPE_GRID_VISIBLE);
- VPE_GRID_OFF = 0;
-
- {/// VpePreviewDoc() Flag Parameters: }
- {/// =============================== }
- VPE_SHOW_NORMAL = 1;
- VPE_SHOW_MAXIMIZED = 2;
- VPE_SHOW_HIDE = 3;
-
- {/// Text-Formatting Attributes: }
- {/// =========================== }
- ALIGN_LEFT = 0;
- ALIGN_RIGHT = 1;
- ALIGN_CENTER = 2;
- ALIGN_JUSTIFIED = 3;
- ALIGN_PRINT = 4;
-
- {/// Frame Attributes: }
- {/// ================= }
- FRAME_INSIDE = 0;
- FRAME_OUTSIDE = 1;
- FRAME_ONCENTER = 2;
-
- {/// Picture Attributes: }
- {/// =================== }
- VPE_PIC_MERGE = 1; {// merge background with bitmap (SRCAND instead of SRCCOPY)}
- VPE_PIC_KEEPIMAGE = 2; {// The KEEP-Flags are only relevant when working with a preview.}
- {/// An image is the (uncompressed and sometimes huge) data in the file }
- {/// that is read into memory. A DIB is an image rendered to the device }
- {/// and another (sometimes huge) datablock. }
- {/// VPE does the following: }
- {/// On VpePicture() the whole image is read into memory and the the image-dimensions }
- {/// are calculated. Afterwards the image is immediately removed from memory. }
- {/// When the preview opens, and if the picture has to be drawn (LOOP), the image }
- {/// is read again into memory and then the DIB is rendered. }
- {/// Afterwards the image-data is immediately removed from memory, since only the }
- {/// DIB is needed to be displayed. }
- {/// The DIB is held in memory until the user moves to another page. }
- {/// When printing with the open preview, the DIB is removed, the image-data }
- {/// is read in and a new DIB is rendered to the capabilities of the new output device. }
- {/// After the DIB is printed, it is immediately removed from memory. }
- {/// The things then continue at "LOOP". }
- {/// This is the standard behaviour of VPE and a balance between execution speed }
- {/// and memory usage. }
- {/// So with the flag VPE_PIC_KEEPIMAGE the turn-around between displaying and }
- {/// printing will speed up. }
- {/// It is also useful, when having only one page (or multiple pages with small }
- {/// Bitmaps) in an open preview, since VPE reads the image-data twice }
- {/// (for getting the dimensions and then for displaying). }
- VPE_PIC_DISCARD_DIB_DRAW = 4; {// VPE holds in a preview all DIB's in memory until the user moves to}
- {/// another page. Using this flag will discard the DIB immediately after drawing }
- {/// from memory }
- VPE_PIC_KEEP_DIB_PAGE = 8; {// VPE discards in a preview all DIB's from memory when the user moves}
- {/// to another page. Using this flag will stop this mechanism. Also it overrides }
- {/// the VPE_PIC_DISCARD_DIB_DRAW flag. }
-
-
-
-
- {/// ======================================================================== }
- {/// Notification Messages: }
- {/// ======================================================================== }
- VPE_DESTROYWINDOW = WM_USER + 2306;
- VPE_PRINT = WM_USER + 2307;
- VPE_PRINTCANCEL = WM_USER + 2308;
- VPE_HELP = WM_USER + 2309;
-
- {/// ======================================================================== }
- {/// Barcode Types: }
- {/// ======================================================================== }
- BCT_EAN13 = 1;
- BCT_EAN8 = 2;
- BCT_UPCA = 3;
- BCT_CODABAR = 5;
- BCT_CODE39 = 6;
- BCT_2OF5 = 7;
- BCT_INTERLEAVED2OF5 = 8;
- BCT_UPCE = 9;
- BCT_EAN13_2 = 10;
- BCT_EAN13_5 = 11;
- BCT_EAN8_2 = 12;
- BCT_EAN8_5 = 13;
- BCT_UPCA_2 = 14;
- BCT_UPCA_5 = 15;
- BCT_UPCE_2 = 16;
- BCT_UPCE_5 = 17;
- BCT_EAN128A = 18;
- BCT_EAN128B = 19;
- BCT_EAN128C = 20;
- BCT_CODE93 = 21;
- BCT_POSTNET = 22;
-
- {/// ======================================================================== }
- {/// Positioning Codes: }
- {/// ======================================================================== }
- VFREE = -1;
- VLEFT = -2;
- VRIGHT = -3;
- VLEFTMARGIN = -4;
- VRIGHTMARGIN = -5;
- VTOP = -6;
- VBOTTOM = -7;
- VTOPMARGIN = -8;
- VBOTTOMMARGIN = -9;
-
- {/// }
- {/// VPIFACE.H }
- {/// ========= }
- {/// }
- {/// The DLL-Interface for the "Virtual Print Engine". }
- {/// }
- {/// To be used by the calling applications. }
- {/// }
- {/// external Macro-Definitions: }
- {/// WINDOWS_DLL generates Windows DLL-Code, else Windows static library }
- {/// }
- {/// 11/94 by IDEAL Software, T. Radde }
- {/// }
-
- function VpeGetVersion: Integer;
-
- function VpeOpenDoc(hWndParent: HWND;
- title: PChar;
- page_width: Integer;
- page_height: Integer;
- flags: LongInt): LongInt;
-
- function VpeCloseDoc(hDoc: LongInt): Integer;
-
- function VpeWindowHandle(hDoc: LongInt): HWND;
-
- procedure VpeSetDefaultOutputRect(hDoc: LongInt;
- r: PRECT);
-
- procedure VpeSetOutputRect(hDoc: LongInt;
- r: PRECT);
-
- procedure VpeGetOutputRect(hDoc: LongInt;
- r: PRECT);
-
- procedure VpeSetPosRect(hDoc: LongInt;
- r: PRECT);
-
- procedure VpeGetPosRect(hDoc: LongInt;
- r: PRECT);
-
- procedure VpeSet(hDoc: LongInt;
- what: Integer;
- value: Integer);
-
- function VpeGet(hDoc: LongInt;
- what: Integer): Integer;
-
- procedure VpeStorePos(hDoc: LongInt);
-
- procedure VpeRestorePos(hDoc: LongInt);
-
- procedure VpeSetScale(hDoc: LongInt;
- scale: Double);
-
- function VpeSetupPrinter(hDoc: LongInt;
- file_name: PChar;
- dialog_control: Integer): Integer;
-
- procedure VpePrintDoc(hDoc: LongInt;
- with_setup: Bool);
-
- function VpeIsPrinting(hDoc: LongInt): Integer;
-
- procedure VpePreviewDoc(hDoc: LongInt;
- rc: PRECT;
- show_hide: Integer);
-
- procedure VpeSetUpdate(hDoc: LongInt;
- yes_no: Integer);
-
- procedure VpeRefreshDoc(h: LongInt);
-
- procedure VpeSetPen(hDoc: LongInt;
- pen_size: Integer;
- pen_style: Integer;
- color: TColorRef);
-
- procedure VpeNoPen(hDoc: LongInt);
-
- procedure VpeLine(hDoc: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer);
-
- function VpePolyLine(h: LongInt;
- p: LongInt;
- size: Word): LongInt;
-
- procedure VpeAddPolyPoint(h: LongInt;
- p: LongInt;
- x: Integer;
- y: Integer);
-
- procedure VpeSetBkgColor(hDoc: LongInt;
- color: TColorRef);
-
- procedure VpeSetTransparentMode(hDoc: LongInt;
- on_off: Integer);
-
- procedure VpeBox(hDoc: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer);
-
- procedure VpeSetBarcodeParms(hdoc: LongInt;
- orientation: Integer;
- top_bottom: BYTE;
- add_top_bottom: BYTE);
-
- procedure VpeBarcode(h: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer;
- code_type: Integer;
- code: PChar;
- add_code: PChar);
-
- procedure VpeKeepBitmapAspect(hdoc: LongInt;
- on_off: Integer);
-
- procedure VpeDefaultBitmapDPI(hdoc: LongInt;
- dpix: Integer;
- dpiy: Integer);
-
- function VpeGetPictureTypes(with_filters: Bool): PChar;
-
- procedure VpePicture(hDoc: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer;
- file_name: PChar;
- flags: Integer);
-
- procedure VpeSelectFont(hDoc: LongInt;
- name: PChar;
- size: Integer);
-
- procedure VpeSetFontAttr(hDoc: LongInt;
- alignment: Integer;
- bold: Integer;
- underlined: Integer;
- italic: Integer);
-
- procedure VpeSetAlign(hDoc: LongInt;
- alignment: Integer);
-
- procedure VpeSetBold(hDoc: LongInt;
- bold: Integer);
-
- procedure VpeSetUnderlined(hDoc: LongInt;
- underlined: Integer);
-
- procedure VpeSetItalic(hDoc: LongInt;
- italic: Integer);
-
- procedure VpeSetTextColor(hdoc: LongInt;
- color: TColorRef);
-
- function VpePrint(h: LongInt;
- x: Integer;
- y: Integer;
- s: PChar): Integer;
-
- function VpePrintBox(h: LongInt;
- x: Integer;
- y: Integer;
- s: PChar): Integer;
-
- function VpeWrite(h: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer;
- s: PChar): Integer;
-
- function VpeWriteBox(hDoc: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer;
- s: PChar): Integer;
-
- procedure VpeDefineHeader(hDoc: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer;
- s: PChar);
-
- procedure VpeDefineFooter(hDoc: LongInt;
- x: Integer;
- y: Integer;
- x2: Integer;
- y2: Integer;
- s: PChar);
-
- procedure VpePageBreak(hDoc: LongInt);
-
- function VpeGetPageCount(hdoc: LongInt): Integer;
-
- function VpeGetCurrentPage(hDoc: LongInt): Integer;
-
- procedure VpeGotoPage(hDoc: LongInt;
- page: Integer);
-
- procedure VpeStoreSet(hDoc: LongInt;
- id: Integer);
-
- procedure VpeUseSet(hDoc: LongInt;
- id: Integer);
-
- procedure VpeRemoveSet(hDoc: LongInt;
- id: Integer);
-
- procedure VpeTplCreatePage(h: LongInt;
- id: Integer);
-
- procedure VpeTplCreateEnd(h: LongInt);
-
- procedure VpeTplUse(h: LongInt;
- id: Integer;
- x: Integer;
- y: Integer);
-
- procedure VpeTplUseEnd(h: LongInt);
-
- function VpeOpenDocFile(hWndParent: HWND;
- file_name: PChar;
- title: PChar;
- page_width: Integer;
- page_height: Integer;
- flags: LongInt): LongInt;
-
- procedure VpeSetRulersMeasure(hDoc: LongInt;
- rulers_measure: integer);
-
- var
- COLOR_BLACK : longint;
- COLOR_DKGRAY : longint;
- COLOR_GRAY : longint;
- COLOR_LTGRAY : longint;
- COLOR_WHITE : longint;
- COLOR_DKRED : longint;
- COLOR_RED : longint;
- COLOR_LTRED : longint;
- COLOR_DKGREEN : longint;
- COLOR_GREEN : longint;
- COLOR_LTGREEN : longint;
- COLOR_BLUEGREEN : longint;
- COLOR_OLIVE : longint;
- COLOR_DKBLUE : longint;
- COLOR_BLUE : longint;
- COLOR_CYAN : longint;
- COLOR_DKPURPLE : longint;
- COLOR_PURPLE : longint;
- COLOR_MAGENTA : longint;
- COLOR_LTYELLOW : longint;
-
- implementation
-
- function VpeGetVersion; external 'VPENGINE';
- function VpeOpenDoc; external 'VPENGINE';
- function VpeCloseDoc; external 'VPENGINE';
- function VpeWindowHandle; external 'VPENGINE';
- procedure VpeSetDefaultOutputRect; external 'VPENGINE';
- procedure VpeSetOutputRect; external 'VPENGINE';
- procedure VpeGetOutputRect; external 'VPENGINE';
- procedure VpeSetPosRect; external 'VPENGINE';
- procedure VpeGetPosRect; external 'VPENGINE';
- procedure VpeSet; external 'VPENGINE';
- function VpeGet; external 'VPENGINE';
- procedure VpeStorePos; external 'VPENGINE';
- procedure VpeRestorePos; external 'VPENGINE';
- procedure VpeSetScale; external 'VPENGINE';
- function VpeSetupPrinter; external 'VPENGINE';
- procedure VpePrintDoc; external 'VPENGINE';
- function VpeIsPrinting; external 'VPENGINE';
- procedure VpePreviewDoc; external 'VPENGINE';
- procedure VpeSetUpdate; external 'VPENGINE';
- procedure VpeRefreshDoc; external 'VPENGINE';
- procedure VpeSetPen; external 'VPENGINE';
- procedure VpeNoPen; external 'VPENGINE';
- procedure VpeLine; external 'VPENGINE';
- function VpePolyLine; external 'VPENGINE';
- procedure VpeAddPolyPoint; external 'VPENGINE';
- procedure VpeSetBkgColor; external 'VPENGINE';
- procedure VpeSetTransparentMode; external 'VPENGINE';
- procedure VpeBox; external 'VPENGINE';
- procedure VpeSetBarcodeParms; external 'VPENGINE';
- procedure VpeBarcode; external 'VPENGINE';
- procedure VpeKeepBitmapAspect; external 'VPENGINE';
- procedure VpeDefaultBitmapDPI; external 'VPENGINE';
- function VpeGetPictureTypes; external 'VPENGINE';
- procedure VpePicture; external 'VPENGINE';
- procedure VpeSelectFont; external 'VPENGINE';
- procedure VpeSetFontAttr; external 'VPENGINE';
- procedure VpeSetAlign; external 'VPENGINE';
- procedure VpeSetBold; external 'VPENGINE';
- procedure VpeSetUnderlined; external 'VPENGINE';
- procedure VpeSetItalic; external 'VPENGINE';
- procedure VpeSetTextColor; external 'VPENGINE';
- function VpePrint; external 'VPENGINE';
- function VpePrintBox; external 'VPENGINE';
- function VpeWrite; external 'VPENGINE';
- function VpeWriteBox; external 'VPENGINE';
- procedure VpeDefineHeader; external 'VPENGINE';
- procedure VpeDefineFooter; external 'VPENGINE';
- procedure VpePageBreak; external 'VPENGINE';
- function VpeGetPageCount; external 'VPENGINE';
- function VpeGetCurrentPage; external 'VPENGINE';
- procedure VpeGotoPage; external 'VPENGINE';
- procedure VpeStoreSet; external 'VPENGINE';
- procedure VpeUseSet; external 'VPENGINE';
- procedure VpeRemoveSet; external 'VPENGINE';
- procedure VpeTplCreatePage; external 'VPENGINE';
- procedure VpeTplCreateEnd; external 'VPENGINE';
- procedure VpeTplUse; external 'VPENGINE';
- procedure VpeTplUseEnd; external 'VPENGINE';
- function VpeOpenDocFile; external 'VPENGINE';
- procedure VpeSetRulersMeasure; external 'VPENGINE';
-
- {$IFDEF VER80}
- initialization
- {$ELSE}
- begin
- {$ENDIF}
- {/// ========================================================================= }
- {/// Color-Definitions }
- {/// ========================================================================= }
- COLOR_BLACK := RGB(0, 0, 0);
- COLOR_DKGRAY := RGB(128, 128, 128);
- COLOR_GRAY := RGB(192, 192, 192);
- COLOR_LTGRAY := RGB(230, 230, 230);
- COLOR_WHITE := RGB(255, 255, 255);
- COLOR_DKRED := RGB(128, 0, 0);
- COLOR_RED := RGB(192, 0, 0);
- COLOR_LTRED := RGB(255, 0, 0);
- COLOR_DKGREEN := RGB(0, 128, 0);
- COLOR_GREEN := RGB(0, 192, 0);
- COLOR_LTGREEN := RGB(0, 255, 0);
- COLOR_BLUEGREEN := RGB(0, 128, 128);
- COLOR_OLIVE := RGB(128, 128, 0);
- COLOR_DKBLUE := RGB(0, 0, 128);
- COLOR_BLUE := RGB(0, 0, 255);
- COLOR_CYAN := RGB(0, 255, 255);
- COLOR_DKPURPLE := RGB(128, 0, 128);
- COLOR_PURPLE := RGB(192, 0, 192);
- COLOR_MAGENTA := RGB(255, 0, 255);
- COLOR_LTYELLOW := RGB(255, 255, 0);
- end.
-